package org.peoples.rooms {
	
	import org.peoples.net.PeoplesProxy;
	import flash.net.Responder;
	
	public class RoomProxy extends PeoplesProxy implements IRoomProxy {
		
		public function RoomProxy(uri:String, handler:Object):void {
			super(uri + "/rooms", handler);
		}
		
		public function removeRoom(roomID:int):void {
			var resp:Responder = new Responder(onResult, onFault);
			conn.call("removeRoom", resp, roomID);
		}
		
		public function joinRoom(roomID:int, userID:int):void {
			var resp:Responder = new Responder(onResult, onFault);
			conn.call("joinRoom", resp, roomID, userID);
		}
		
		public function getRoomUsers(roomID:int):void {
			var resp:Responder = new Responder(onResult, onFault);
			conn.call("getRoomUsers", resp, roomID);
		}
		
		public function getRooms():void {
			var resp:Responder = new Responder(onResult, onFault);
			conn.call("getRooms", resp);
		}
		
		public function leaveRoom(roomID:int, userID:int):void {
			var resp:Responder = new Responder(onResult, onFault);
			conn.call("leaveRoom", resp, roomID, userID);
		}
		
		public function createRoom(name:String, description:String, creationDate:Date):void {
			var resp:Responder = new Responder(onResult, onFault);
			conn.call("createRoom", resp, name, description, creationDate);
		}
		
	}
}